package com.example.sys.calendar.service;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.core.mapping.Mapping;
import com.example.core.service.BaseServiceImpl;
import com.example.sys.calendar.dao.SysCalendarDao;
import com.example.sys.calendar.mapping.SysCalendarMapping;
import com.example.sys.calendar.po.SysCalendar;
import com.example.sys.calendar.vo.SysCalendarVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysCalendarServiceImpl extends BaseServiceImpl<SysCalendarDao, SysCalendar, SysCalendarVo> implements SysCalendarService {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public Class<? extends Mapping> getMappingClass() {
        return SysCalendarMapping.class;
    }

    /***
     *
     * 查询一个月里面有多少
     * @param nowDay
     * @return
     * @throws Exception
     */
    @Override
    public List<String> getCalendar(String nowDay) throws Exception {
        QueryWrapper<String> queryWrapper = new QueryWrapper<>();
        DateTime startTime = DateUtil.beginOfMonth(DateUtil.parse(nowDay));
        DateTime endTime = DateUtil.endOfMonth(DateUtil.parse(nowDay));
        return null;
    }

    /***
     *
     * 查询默认本周的所有的日程信息
     * @return
     */
    @Override
    public List<SysCalendar> getCalendar() {
        return null;
    }
}
